<?php

if (!$user->is_logged_in)
{
	redirect('login.php');
	gerror_page(
		'Not logged in', 
		'You must be logged in as an administrator to view this page.'
	);
}
else
{
	if ($user->user_info['rank'] != 'admin')
	{
		redirect('../index.php');
		gerror_page(
			'Insufficient permissions', 
			'You must be logged in as an administrator to view this page.'
		);
	}	
}

if (!is_dir(ADM_TEM_DIR))
{
	gerror_page(
		'Template Error', 
		'The specfied template folder does not exist.'
	);
}

$tpl->setPath('template', ADM_TEM_DIR);